package app

import (
	"hub.hddznet.com/uniplatform/framework/context"
)

var cfg *context.Configuration

func MustBool(section, key string, defaultVal ...bool) bool {
	if cfg == nil {
		panic("配置文件未初始化...")
	}
	return cfg.INI.MustBool(section, key, defaultVal...)
}
func MustValue(section, key string, defaultVal ...string) string {
	if cfg == nil {
		panic("配置文件未初始化...")
	}
	return cfg.INI.MustValue(section, key, defaultVal...)
}

func GetConfig() *context.Configuration {
	return cfg
}

func HasConfigInit() bool{
	if cfg != nil {
		return true
	}
	return false
}
